
<!-- 正文开始 -->
<div class=" layui-form open-form">
    <div class="open-model">
        <div class="open-auto">

            <div class="layui-form lay-header" style="margin-top: 20px;height: 60px">
                <div class="toolbar">
                    <div class="layui-form-item lay-query-content">
                        <div class="lay-query-box">
                            <div class="query-lt">
                                <div class="layui-inline">
                                    <label class="layui-form-label">选择工艺：</label>
                                    <div class="layui-input-inline mr0">
                                        <select id="processingName" name="processingName" lay-filter="processingName" lay-search lay-verify=""></select id="processingTypeName">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">选择品种：</label>
                                    <div class="layui-input-inline mr0">
                                        <select id="varietyName" name="varietyName" lay-filter="varietyName" lay-search lay-verify=""></select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">选择钢种：</label>
                                    <div class="layui-input-inline mr0">
                                        <select id="markName" name="markName" lay-filter="markName" lay-search lay-verify=""></select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">选择客户：</label>
                                    <div class="layui-input-inline mr0">
                                        <select id="customerName" name="customerName" lay-filter="customerName" lay-search lay-verify=""></select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">状态：</label>
                                    <div class="layui-input-inline mr0">
                                        <select name="isDelete" lay-filter="isDelete">
                                            <option value="">请选择</option>
                                            <option value="0">正常</option>
                                            <option value="1">禁用</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <button class="layui-btn icon-btn color-green" lay-filter="itemSubSearchTwo"
                                            lay-submit layui-form-keyDownSearch="true">查询
                                    </button>
                                    <button class="layui-btn icon-btn color-white" lay-filter="itemResetsTwo"
                                            lay-submit>重置
                                    </button>
                                </div>
                            </div>
                            <div class="query-rt"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item ">
                <button class="layui-btn" id="selectAll">确认选择</button>
            </div>
            <!-- 表格 -->
            <table class="layui-table" lay-filter="SelectTable" id="SelectTable"></table>

            <!--      <table class="layui-table" id="warehouseMaterialRequisitionRecordTable"-->
            <!--             lay-filter="warehouseMaterialRequisitionRecordTable"></table>-->
        </div>

    </div>
</div>

<script>
    layui.use(["layer", "form", "table", "admin", "laydate", "upload", "laytpl"], async function () {
        const table = layui.table;
        const config = layui.config;
        const laytpl = layui.laytpl;
        const form = layui.form;
        const admin = layui.admin;
        const layer = layui.layer;
        const upload = layui.upload;
        const laydate = layui.laydate;
        const $ = layui.jquery;
        const nowData = { ...parentData };
        // 初始化产线下拉框

        admin.initDataSelect("enterprise/sell/admin/customersInfo/list", {limit: 9999}, "customerName", null, "客户信息", 'customerName', null);
        admin.initDataSelect("warehouse/warehouse/admin/productMark/list", {limit: 9999}, "markName", null, "钢种", 'markName', null);
        admin.initDataSelect("warehouse/warehouse/admin/productVariety/list", {limit: 9999}, "varietyName",  null, "品种", 'varietyName', null);
        admin.initDataSelect("enterprise/dict/admin/dictLabel/list?dictType=warehouse_processingType", {limit: 9999}, "processingName", null, "工艺", 'labelName', null);



        var tableTwo = table.render({
            elem: "#SelectTable",
            url: config.base + 'warehouse/warehouse/warehouseProcessingDescription/list',
            page: true,
            defaultToolbar: ["filter"],
            where: { access_token: config.getToken().access_token },
            cols: [
                [
                    { type: "checkbox" },
                    {type: "numbers", title: "序号", fixed: "left"},
                    {field: "processingTypeName", title: "适用工艺", align: "center"},
                    {field: "productVarietyName", title: "适用品种", align: "center"},
                    // {field: "customerLevelId", title: "客户级别", align: "center"},
                    {field: "productMarkName", title: "适用钢种", align: "center"},
                    {field: 'customerName', title: '适用客户', align: 'center'},
                    {field: "remark", title: "描述", align: "center"},
                    {
                        field: "isDeleted",
                        title: "状态",
                        align: "center",
                        templet: function (d) {
                            if(d.isDeleted){
                                return "禁用"
                            }else{
                                return "正常"
                            }
                        },
                    },
                    // {field: 'creatorName', title: '创建人' , align: 'center'},
                    // {field: "createTime", title: "添加时间", align: "center"},
                ]
            ]
        });

        // 搜索
        form.on("submit(itemSubSearchTwo)", function (data) {
            tableTwo.reload({
                where: {
                    ...data.field,
                },
                page: { curr: 1 }
            });
        });

        // 重置搜索
        form.on("submit(itemResetsTwo)", function (data) {
            tableTwo.reload({
                where: {
                    ...admin.resetSearch(data.field),
                },
                page: { curr: 1 }
            });
        });

        form.render("select");


        $("#selectAll").click(function () {
            const checkStatus = table.checkStatus("SelectTable").data;
            console.log(checkStatus,"checkStatus")
            childData.SelectList = checkStatus;
            layer.close(nowData.zindex);
        });
    });
</script>

<style>
    .open-auto{
        position: relative;
        z-index: 10000;
        overflow: visible !important;
    }
    .layui-form-select dl{
        /*max-height:140px !important;*/
    }
</style>